﻿@using System.Web
@using EasyWeb.Models
@model DirectoryModel
@{
    var ps = Model.Parents;
}
<section id="main">
    <header>
        @if (ps.Count > 1)
        {
            <h1>
                目录
                @for (var i = ps.Count - 1; i >= 0; i--)
                {
                    <a href="/@ps[i].Path">@ps[i].Name/</a>
                }
            </h1>
        }
    </header>
    <table class="table table-bordered table-hover table-striped table-condensed">
        <tr>
            <th><a href="?sort=time">时间</a></th>
            <th><a href="?sort=size">大小</a></th>
            <th><a href="?sort=name">名称</a></th>
            <th>哈希</th>
        </tr>
        @foreach (var item in Model.Entries)
        {
            <tr>
                <td>@item.LastWrite.ToFullString("")</td>
                <td>@item.Size.ToGMK()</td>
                <td>
                    <a href="@item.Url" title="@item.Title">@item.Name</a>
                </td>
                <td style="max-width:200px;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">@(item.IsDirectory ? "<dir>" : item.Hash)</td>
            </tr>
        }
    </table>
</section>
